package com.imut.hcdp.controller;

import com.imut.hcdp.common.Rst;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;


@RestController
public class UploadFileController {


    @GetMapping("/upd")
    public Rst handleFileUpload(@RequestParam("file") MultipartFile file) {
        try {
            file.transferTo(new File("D:/sys/"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return Rst.success("http://localhost:9798/pic/" + file.getOriginalFilename());
    }
}
